import 'util.dart';

class KeyValModel extends ObjectEx {
  String key;
  String? val;
  String? detail;
  int? idx;
  KeyValModel({
    required this.key,
    this.detail,
    this.val,
    this.idx,
  });

  @override
  String get idKey => key;

  Map<String, dynamic> toJson() => {
        'key': key,
        'val': val,
        'detail': detail,
        'idx': idx,
      };

  factory KeyValModel.fromJson(Map<String, dynamic> json) => KeyValModel(
        key: json['key'] as String? ?? '',
        val: json['val'] as String?,
        detail: json['detail'] as String?,
        idx: json['idx'] as int?,
      );
}
